<?php

if ( !function_exists('app'))
{
    /**
     * @param null $name
     * @return \App\Container\Container
     * @throws \App\Container\Exceptions\NotExistException
     */
    function app($name = null){
        static $container;
        if(!$container)
        {
            $container = new App\Container\Container();
        }
        if($name)
        {
           return $container->get($name);
        }
        return $container;
    }
}
